<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>功能</title>
<link rel="shortcut icon" type="image/ico" href="${basePath}/favicon.ico?v=1"/>
<link rel="stylesheet" type="text/css" href="${basePath}/css/style_2_common.css?BPm" />
<link href="${basePath}/css/style-1.css?id=103" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${basePath}/css/default_user_com.css" media="all">
<link rel="stylesheet" type="text/css" href="${basePath}/js/ztree/css/style.css" />
<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="${basePath}/js/ztree/jquery.ztree.core-3.5.min.js"></script>
<script type="text/javascript" src="${basePath}/js/ztree/jquery.ztree.excheck-3.5.min.js"></script>
<style type="text/css">
div.content_wrap {width: 90%;height:90%;}
div.content_wrap div.left{float: left;width:100%;}
div.function_background {width:100px;height:100%;text-align:left;padding-left:10px;}
.btnGreen{margin-top:50px;margin-bottom: 100px;}
</style>
</head>
<body>
<div class="content_wrap">
	<div class="function_background left">
		<ul id="tree_panel" class="ztree"></ul>
		<input class="btnGreen right" type="button" onclick="authrize()" value="确定"/>
	</div>
</div>

<script type="text/javascript">
var setting = {check: {enable: true,chkboxType:{"Y":"s","N":"s"}},data: {simpleData: {enable: true,idKey: "id",pIdKey: "parentId",rootPId: 0}}};
<#if nodes?exists>
var zNodes=${nodes};
<#else>
var zNodes=[];
</#if>
var zTreeObj = $.fn.zTree.init($("#tree_panel"), setting, zNodes);
var rid=${roleid};
function authrize(){
	var changedNodes = zTreeObj.getChangeCheckedNodes();
	var ids = new Array();
	if(changedNodes.length>0){
		var nodes = zTreeObj.getCheckedNodes(true);
		var len = nodes.length;
		for(var i=0;i<len;i++){
			ids.push(nodes[i].id);
		}
		ids = ids.join(",");
	}
	parent.authFun(ids, rid);
}
</script>
</body>
</html>